wayland: Silence warnings on clipboard data sending cancellation
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 19 Mar 2015 14:58:00 +0000 (15:58 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 19 Mar 2015 15:05:04 +0000 (16:05 +0100)
During copy/paste, it may be common that we receive several property changes
around the selection atom, this results in warnings when cancelling the previous
write attempt. We already honor the last request properly, so we should just
cancel silently.

gdk/wayland/gdkselection-wayland.c

index 043ca7d6df0c74a79a8700115165498387d11546..12a2d30f7b8bebd986f2692899284a5ce45b039b 100644 (file)
@@ -416,9 +416,11 @@ async_write_data_cb (GObject      *object,
                                                 res, &error);
   if (error)
     {
-      g_warning ("Error writing selection data: %s", error->message);
-      g_error_free (error);
+      if (error->domain != G_IO_ERROR ||
+          error->code != G_IO_ERROR_CANCELLED)
+        g_warning ("Error writing selection data: %s", error->message);
 
+      g_error_free (error);
       async_write_data_free (write_data);
       return;
     }